<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>点播测试</title>
  <script type="text/javascript" src="/Utility/CoreScripts/polyfill.min.js?ver=1.8.7177.20922"></script>


  <script src="qiniu-web-player-1.2.3.js"></script>
</head>

<body>
  <div id="player" style="width: 100vw; height: calc(100vw * 9/16);"></div>
  <div id="info" style="position: absolute;z-index:100; top:0px;left:0px;">播放时间：<span id="curtime">0</span></div>
  <script>
    var container = document.getElementById("player");
    var player = new QPlayer({
      url: "/Upload/Course/Video/20190227043725.mp4",
      //url:"http://weisha100.cn/Upload/Course/Video/20190227043725.mp4",
      container: container,
      autoplay: true,
      loop:"loop",
      loggerLevel:0
    });
    // 注册 ready 的监听函数，但是只会触发一次
    player.once("ready", function () {
      //隐藏全屏按钮
      var fullbtn = document.getElementsByClassName("qplayer-fullscreen");
      for (var i = 0; i < fullbtn.length; i++) {
        fullbtn[i].style.display = "none";
      }
      //隐藏设置按钮(播放倍速也禁用了)
      var setbtn = document.getElementsByClassName("qplayer-settings-btn");
      for (var i = 0; i < setbtn.length; i++) {
        setbtn[i].style.display = "none";
      }
    });
    window.setInterval(function () {
      var curtime = document.getElementById("curtime");
      curtime.innerHTML = player.currentTime;
    }, 10);
  </script>
</body>

</html>